from MeshToolKit.mesh_node import *
from MeshToolKit.mesh_entry import *
from MeshToolKit.mesh import *

if __name__ == '__main__':
	#m = mesh(dump_filename = 'dump', des_filename = 'MESH/ascii/d2007.bin')
	# print m.lookup_id('D12.776.124.486.485.705.750.530.500').description
	# print m.lookup_id('C16.320.565.300.281').description
	# print m.lookup_name('Dystonia Musculorum Deformans')[0].description
	# print m.lookup_name('Mammary Glands, Human')[0].description
	m = mesh(mesh_filename="../MeshParser/Mesh/ascii/mtrees2007.bin", des_filename="../MeshParser/Mesh/ascii/d2007.bin", dump_filename="dump")
	#lookup for an id
	print m['C16.320.565.300.281'], '\n' 
	#lookup for a name gives list of id's as one name can have more than one sense
	#entry = m['Colonic Neoplasms'][1].entry
	#print 'Description is', entry.description
	#print '\n'.join(entry.entries)
	#print '\n'.join(entry.only_clean_entries())
	#aterms = m.get_approximate_terms("mad caw disease") #gives terms in the mesh database which are near to the term given
	#print aterms
	
	#terms = m.lookup_entry_term("mad cow disease")
	#for t in terms:
	#	print t.entry.only_clean_entries()
	#print '\n'.join([term.id+'\t'+term.name+'\t' for term in terms])
	#check mesh_node.py for the things contained in mesh_node object
	